package br.com.sacolacheia.tarefa;

import java.util.ArrayList;
import java.util.HashMap;


public class itensPreco {

	// select barcode, 	idretailer, price from price
	// "barcode" -> ("idretailer1", "preco1"), ("idretailer...", "preco..."), ("idretailerN", "precoM")
	
	private HashMap<String, ArrayList<retailerPreco>> itens = null;

	public itensPreco(HashMap<String, ArrayList<retailerPreco>> itens) {
		super();
		this.itens = itens;
	}

	public itensPreco() {
		super();
	}
	
	public void putItem (String barcode, retailerPreco rp) {
		ArrayList localitens = null;
		
		if (this.itens.containsKey(barcode)){
			localitens = this.itens.get(barcode);
			localitens.add(rp);
		}else{
			localitens = new ArrayList<retailerPreco>();
			localitens.add(rp);
			this.itens.put(barcode, localitens);
		}
	}
	
	
}
